# 设置项目 cmake 的最低版本
cmake_minimum_required(VERSION 3.21)

# 设置项目名称
set(PROJECT_NAME c-project-04-mysql-connect-pool-c)
project(${PROJECT_NAME} C)

# 设置项目的 C 版本
set(CMAKE_C_STANDARD 11)

# 设置可执行程序的生成位置
set(EXECUTABLE_PATH ${PROJECT_SOURCE_DIR}/bin)

# 设置头文件路径
set(INCLUDE_PATH ${PROJECT_SOURCE_DIR}/include)

# 设置静态库或动态库的生成位置
set(LINK_LIB_PATH ${PROJECT_SOURCE_DIR}/lib)

# 设置静态库和动态库的名称
set(MYSQL_CONNECT_POOL_STATIC_LIB mysql-connect-pool-static)
set(MYSQL_CONNECT_POOL_SHARED_LIB mysql-connect-pool-shared)

# 设置项目包含的头文件
include_directories("/cygdrive/D/Environment/Mysql/mysql-5.7.44/include")

# 设置链接静态库或动态库的地址
link_directories("/cygdrive/D/Environment/Mysql/mysql-5.7.44/lib")

# 链接静态库
link_libraries(libmysql)
# Linux 环境下修改为下列静态库即可
# link_libraries(pthread)
# link_libraries(mysqlclient)

# 设置子项目工程
add_subdirectory(source)
add_subdirectory(example-link-shared-lib)
add_subdirectory(example-link-static-lib)